#ifndef GX_FR_EDITOR_POINTERSTATE_H
#define GX_FR_EDITOR_POINTERSTATE_H

#include "State.h"
#include "BoxTweaker.h"

namespace FinalRendering
{
	namespace Editor
	{	
		class PointerState : public State
		{
		private:
			int ToolMode; 
		private:
			void SelectionScaled();
			void SelectionMoved(vec3 &trans);
			void SelectionTwisted();
			void SelectionRotated();
			void RotateSelection(Matrix4 &mat, Matrix4 &MatLocTrans);
			void Draw(View* view);
		protected:
			RefPtr<BoxTweaker> BoxTweaker;
		public:
			void Initialize();
			void Finalize();
			void UpdateSelection();
			void DoSelection(Array<Selection> &sel);
			vec3 GetSelectionCenter();
			float GetSelectionRadius();
		public:
			void SetTransformMode(int m);
			void Rotate90Degrees(int axis, bool dir);
			void ChangeCursor(View *View, UIMouseEventArgs &e);
			void DrawStates(View *View);
		public:
			PointerState();
			virtual void DrawState_3DView(View3D * view);
			virtual void DrawState_LeftView(ViewLeft* view);
			virtual void DrawState_TopView(ViewTop * view);
			virtual void DrawState_FrontView(ViewFront * view);

			virtual void MouseDown(View * view, UIMouseEventArgs & e);
			virtual void MouseUp(View * view, UIMouseEventArgs & e);
			virtual void MouseMove(View * view, UIMouseEventArgs & e);
		};
	}
}

#endif